const express = require('express');
const router = express.Router();

router.get('/', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        brandCode: 'string',
        brandName: 'string',
        planCode: 'string',
        marketDepartmentName: 'string',
        country: 'string',
        dealerCode: 'string',
        dealerName: 'string',
        manufacturerName: 'string',
        submitYear: 2020,
        submitMonth: 3,
        status: 1,
        creatorName: 'string',
        createTime: '2020-03-06T03:33:36.533Z',
        rowVersion: 'string',
        options: [
            'update',
            'approve',
            'submit',
            'abandon',
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/quantity', (req, res) => {
    const content = [];
    for(let i = 0; i < 5; i++) content.push({
        assembleMethod: 1,
        materialGroupKDBOMCode: 'string',
        referenceMaterialGroupKDBOMCode: 'string',
        n1QuantityYearBefore: 100,
        n1QuantityMonthBefore: 150,
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                brandCode: 'string',
                brandName: 'string',
                planCode: 'string',
                manufacturerId: 'string',
                marketDepartmentName: 'string',
                country: 'string',
                dealerCode: 'string',
                dealerName: 'string',
                manufacturerName: 'string',
                submitYear: 2020,
                submitMonth: 3,
                status: 1,
                creatorName: 'string',
                createTime: '2020-03-06T03:39:57.830Z',
                rowVersion: 'string',
                brandId: 'string',
                dealerId: 'string',
                dutyUintId: 'string',
                total: 'string',
                detailTotal: 'string',
                modiferName: 'string',
                modifyTime: '2020-03-06T03:39:57.830Z',
                submitterName: 'string',
                submitTime: '2020-03-06T03:39:57.830Z',
                abandonerName: 'string',
                abandonTime: '2020-03-06T03:39:57.830Z',
                confirmorName: 'string',
                confirmTime: '2020-03-06T03:39:57.830Z',
                approvedContent: 'string',
                remark: 'string',
                options: [
                    'update',
                    'approve',
                    'submit',
                    'abandon',
                ],
                details: [
                    {
                        id: '1',
                        assembleMethod: 1,
                        materialGroupKDBOMCode: 'string',
                        referenceMaterialGroupKDBOMCode: 'string',
                        newModel: true,
                        modelCode: 'string',
                        n1Quantity: 1,
                        n2Quantity: 1,
                        n3Quantity: 1,
                        n4Quantity: 1,
                        n5Quantity: 1,
                        n6Quantity: 1,
                        total: 20,
                        detailRemark: 'string'
                    }
                ],
            }
        }
    );
});

router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});
router.post('/', (req, res) => {
    res.json({
        message: '新增成功'
    });
});
router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废成功'
    });
});
router.put('/:id/pass', (req, res) => {
    res.json({
        message: '审核通过'
    });
});
router.put('/:id/reject', (req, res) => {
    res.json({
        message: '审核拒绝'
    });
});
router.get('/:id/export', (req, res) => {
    res.json({
        message: '导出成功'
    });
});
router.post('/batchImport', async(req, res) => {
    res.json({
        message: '批量导入成功'
    });
});
module.exports = router;
